package com.ict.txmsv2.controller;

import com.ict.txmsv2.model.MethodDescrition;
import com.ict.txmsv2.model.User;
import com.ict.txmsv2.services.UserService;
import com.ict.txmsv2.utils.UserUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author linzzz
 * @desc ...
 * @date 2020-12-20
 */
@RestController
@RequestMapping("/chat")
public class ChatController {

    @Autowired
    UserService userService;

    @GetMapping("/users")
    @MethodDescrition("获取除自己外的其他用户")
    public List<User> getAllUsers(){
        return userService.getAllUserExcludeCurrentUser(UserUtils.getCurrentHr().getId());
    }
}
